#include "GBox.h"

GBox::GBox()
	: size(1)
	, r(0)
	, g(0)
	, b(0)
{
	SetCorners( vec3(size/2), vec3(-size/2) );
}

GBox::GBox(float Size)
	: size(Size)
	, r(0)
	, g(0)
	, b(0)
{
	SetCorners( vec3(size/2), vec3(-size/2) );

	dList = glGenLists(1);
	glNewList(dList, GL_COMPILE);
		glutSolidCube(size);
	glEndList();
}

void GBox::Draw(void)
{
	glColor3f(r,g,b);
	glCallList(dList);
}

void GBox::SetColor(float R, float G, float B)
{
	r = R; g = G; b = B;
}